﻿using System;
using System.ComponentModel.DataAnnotations;

namespace Md.Api.Model;
/// <summary>
/// 统一提交实体类
/// </summary>
public class RequestModel
{
    private string? guidkey;
    /// <summary>
    /// 标识码
    /// </summary>
    public string GuidKey
    {
        get => guidkey ?? Guid.NewGuid().ToString();
        set => guidkey = value;
    }

    /// <summary>
    /// 商户CODE
    /// </summary>
    [Required(ErrorMessage = "商户CODE(MerchantId)必须填写")]
    public string? MerchantId
    {
        get; set;
    }

    /// <summary>
    /// AES加密后的json数据
    /// </summary>
    [Required(ErrorMessage = "AES加密后的json数据(Data)必须填写")]
    public string? Data
    {
        get; set;
    }

    /// <summary>
    /// AESkey(证书加密后的数据)
    /// </summary>
    [Required(ErrorMessage = "AESkey证书加密后的数据(EncryptKey)必须填写")]
    public string? EncryptKey
    {
        get; set;
    }
}

